@import "variables";

.card-list {
  .card-list-item {
    padding: 10px 10px 20px;
  }

  .card {
    display: block;
    overflow: hidden;
    width: 100%;
    box-shadow: 0 0 1px rgba(128, 128, 128, 0.2);
    border-radius: 3px;
    background-color: #fff;
    text-decoration: none;

    &:hover,
    &:focus {
      box-shadow: 0 0 15px rgba(128, 128, 128, 0.5);
    }
  }

  .card-header {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 0;
    padding-top: 61.886%;

    a {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;

      img {
        width: 100%;
        height: 100%;
      }
    }
  }

  .card-footer {
    padding: 20px 30px 16px;
    text-align: center;
    line-height: 2em;
  }

  .card-title {
    margin: 0;
    font-size: 16px;

    a {
      display: block;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      color: $card-title;

      &:hover,
      &:focus {
        color: $card-title-hover;
      }
    }
  }

  .card-author {
    font-size: 12px;
    font-style: normal;

    a {
      color: $card-author;

      &:hover,
      &:focus {
        color: $card-author-hover;
      }
    }
  }

  .card-date {
    font-size: 12px;
    font-weight: 200;
    color: $card-date;
  }
}

@media (max-width: 767px) {
  .card-list {
    .card-list-item {
      padding: 10px;
    }

    .card-header {
      padding-top: 58.57%;
    }

    .card-footer {
      padding: 7px 10px 6px;
    }

    .card-title {
      font-size: 14px;
    }
  }
}

@media (min-width: 768px) {
  .card-list {
    .card-list-item {
      &:nth-child(even) {
        padding-left: 20px;
      }

      &:nth-child(odd) {
        padding-right: 20px;
      }
    }
  }
}

@media (min-width: 1024px) {
  .card-list {
    .card-list-item {
      &:nth-child(even) {
        padding-left: 10px;
      }

      &:nth-child(odd) {
        padding-right: 10px;
      }
    }
  }
}
